package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbCommentMapper;
import com.ruoyi.system.domain.DbComment;
import com.ruoyi.system.service.IDbCommentService;

/**
 * 咨询浏览评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-22
 */
@Service
public class DbCommentServiceImpl implements IDbCommentService 
{
    @Autowired
    private DbCommentMapper dbCommentMapper;

    /**
     * 查询咨询浏览评论
     * 
     * @param id 咨询浏览评论主键
     * @return 咨询浏览评论
     */
    @Override
    public DbComment selectDbCommentById(Long id)
    {
        return dbCommentMapper.selectDbCommentById(id);
    }

    /**
     * 查询咨询浏览评论列表
     * 
     * @param dbComment 咨询浏览评论
     * @return 咨询浏览评论
     */
    @Override
    public List<DbComment> selectDbCommentList(DbComment dbComment)
    {
        return dbCommentMapper.selectDbCommentList(dbComment);
    }

    /**
     * 新增咨询浏览评论
     * 
     * @param dbComment 咨询浏览评论
     * @return 结果
     */
    @Override
    public int insertDbComment(DbComment dbComment)
    {
        dbComment.setCreateTime(DateUtils.getNowDate());
        return dbCommentMapper.insertDbComment(dbComment);
    }

    /**
     * 修改咨询浏览评论
     * 
     * @param dbComment 咨询浏览评论
     * @return 结果
     */
    @Override
    public int updateDbComment(DbComment dbComment)
    {
        dbComment.setUpdateTime(DateUtils.getNowDate());
        return dbCommentMapper.updateDbComment(dbComment);
    }

    /**
     * 批量删除咨询浏览评论
     * 
     * @param ids 需要删除的咨询浏览评论主键
     * @return 结果
     */
    @Override
    public int deleteDbCommentByIds(Long[] ids)
    {
        return dbCommentMapper.deleteDbCommentByIds(ids);
    }

    /**
     * 删除咨询浏览评论信息
     * 
     * @param id 咨询浏览评论主键
     * @return 结果
     */
    @Override
    public int deleteDbCommentById(Long id)
    {
        return dbCommentMapper.deleteDbCommentById(id);
    }
}
